package com.limit.utils;

import java.util.Properties;

import com.jfinal.log.Log4jLogger;
import com.jfinal.log.Logger;

/**
 * 加载properties配置文件工具类
 * @author maoyun(maoyun0903@163.com)
 * @date 2014-1-7 上午10:21:56 
 * @version V1.0
 */
public class PropertiesUtil {
	private static Logger log =  Log4jLogger.getLogger(PropertiesUtil.class);
	private static String properties = "/config.properties";
	private static Properties pro = null ;
	
	static{
		pro = new Properties();
		try {
			pro.load(PropertiesUtil.class.getResourceAsStream(properties));
		} catch (Exception e) {
			log.error("load properties file error location in com.nubb.utils.PropertiesUtil.class");
		}
	}
	/**
	 * 加载配置文件,key->value
	 */
	public static String load(String key){
		if(null == key || key.trim().equals(""))
			return null;
		return pro.getProperty(key);
	}
	
	
	
	
	
	
	
	
	
}
